package day03.text02;

import java.util.concurrent.*;

public class Test {
    public static void main(String[] args) {
        MyRunable myRunable = new MyRunable();

        ExecutorService singleThreadPool = new ThreadPoolExecutor(2, 10,
                0L, TimeUnit.MILLISECONDS,
                new LinkedBlockingQueue<Runnable>(10), Executors.defaultThreadFactory(), new ThreadPoolExecutor.AbortPolicy());

        singleThreadPool.submit(myRunable);
        singleThreadPool.submit(myRunable);
        singleThreadPool.submit(myRunable);
        singleThreadPool.submit(myRunable);

        singleThreadPool.shutdown();


    }
}
